function deepClone(obj){
  if (!obj) {
    return obj
  }
  const newObj = obj instanceof Array ? [] : {}
  for(let k in obj){
      if(obj.hasOwnProperty(k)){
        newObj[k] = typeof obj[k] === 'object' ? deepClone(obj[k]) : obj[k]
      }
  }
  return newObj
}